Class Dlg extends Box
public var closed=false;
public var base;
function Dlg(){
 	G.main.addChild(this);
 	this.setSize(G.w,G.h);
 	this.addChild({dim:"base",w:"f",h:"f",bg:"#000",alpha:0.3});
}
function close(){
	if(this.closed) return;
	this.closed=true;
	this.onClose();
}
function onClose(){
	this.remove();
}
function onClick(){
	if(G.target==this.base) this.close();
}